var LoginPage = function (br) {
    this.browser = br || browser;

    var username = element(by.css('input[placeholder="Username"]'));
    var password = element(by.css('input[placeholder="Password"]'));
    var login = element(by.buttonText('Sign in'));
    
    this.get = function () {
        this.browser.waitForAngularEnabled(false);
        this.browser.get('file:///F:/git/test/protractor/E2E/html/login.html');
    }

    this.setUserName = function (name) {
        console.log('username:' + username);
        username.sendKeys(name);
    }

    this.setPassword = function (psd) {
        //console.log(password);
        password.sendKeys(psd);
        //console.log('password: ' + password);
    }

    this.logIn = function () {
        return login.click();
    }

    this.logOut = function () {
        this.browser.waitForAngularEnabled(false);
        this.browser.get('file:///F:/thomas/UI/gentelella/production/login.html');
    }

    this.performLogin = function () {
        //this.get();
        this.setUserName(this.browser.params.username);
        this.setPassword(this.browser.params.password);
        this.logIn();
    }
};
//export LoginPage as a class
module.exports = LoginPage;